package ioc08;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/5/16 16:45
 * Version:1.0-SNAPSHOT
 * Description:
 */
public class Test {

    public static void main(String[] args) {
        // 延迟实例化
        // 当使用到对应的bean的时候
        // 才会对该bean进行实例化操作
        Resource resource = new ClassPathResource("ioc08/spring.xml");
        BeanFactory bf = new XmlBeanFactory(resource);
        System.out.println("-------------------");
        SomeBean someBean = (SomeBean) bf.getBean("someBean");
    }

}
